package com.quanyan.place.service.impl;

import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.quanyan.place.component.ScheduledTask;
import com.quanyan.place.mapper.PlaceBlockBookingOrderMapper;
import com.quanyan.place.service.PlaceBlockBookingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Kingson.chan on 2016/9/24 0024.
 */
@Service("placeBlockBookingServiceImpl")
public class PlaceBlockBookingServiceImpl implements PlaceBlockBookingService {

    private static Logger logger = LoggerFactory.getLogger(ScheduledTask.class);

    @Autowired
    PlaceBlockBookingOrderMapper placeBlockBookingOrderMapper;

    @Override
    public boolean updateBlockBookingOrderEffectiveStatus() {
        /*List<Integer> tbBizPlaceOrderList = placeBlockBookingOrderMapper.selectParentIds();
        if(CollectionUtils.isNotEmpty(tbBizPlaceOrderList)){
            PlaceBlockBookingVo placeBlockBookingVo = new PlaceBlockBookingVo();
            placeBlockBookingVo.setUpdateDate(new Date(System.currentTimeMillis() + 7 * 24 * 60 * 60 * 1000));
            placeBlockBookingVo.setParentIds(tbBizPlaceOrderList);
            int result = placeBlockBookingOrderMapper.updateEffectiveStatus(placeBlockBookingVo);
            logger.info("当前时间一周内的包场订单设置为可用状态执行成功。");
        }*/
    
        int result = placeBlockBookingOrderMapper.updateOrderEffectiveStatus();
        logger.info("当前时间一周内的包场订单设置为可用状态执行成功。");
        return true;

    }

}
